Skip to content

Instantly share code, notes, and snippets.

View garenyondem's full-sized avatar
:shipit:

Garen Yöndem garenyondem

:shipit:
  • Afiniti
  • 02:12 (UTC +03:00)
View GitHub Profile
@niqdev
niqdev / rename-branch-github.txt
Last active January 15, 2020 18:17
Rename local and remote branch on GitHub
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@Yimiprod
Yimiprod / difference.js
Last active April 5, 2024 13:17
Deep diff between two object, using lodash
/**
* This code is licensed under the terms of the MIT license
*
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
@mdwheele
mdwheele / yosemite-sound-issues.md
Created October 22, 2014 00:25
Fix Yosemite Bluetooth Sound Issues
  1. Run the following in your terminal.
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool Min (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 80
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 80
@kelvinn
kelvinn / cmd.sh
Created July 24, 2014 02:55
Example of using Apache Bench (ab) to POST JSON to an API
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/
@ericsaboia
ericsaboia / uncaughtException.js
Created May 19, 2014 15:11
Sending emails on uncaughtException
if (config.admin.email) {
process.on('uncaughtException', function(err) {
console.log(err.stack);
nodemailer.createTransport("SMTP", {
service: "Sendgrid"
, auth: {
user: config.smtp.username
, pass: config.smtp.password
}
}).sendMail({
using Microsoft.Phone.Controls;
using System;
using System.Windows.Controls.Primitives;
/// <summary>
/// This class detects the pull gesture on a LongListSelector. How does it work?
///
/// This class listens to the change of manipulation state of the LLS, to the MouseMove event
/// (in WP, this event is triggered when the user moves the finger through the screen)
/// and to the ItemRealized/Unrealized events.
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active May 7, 2024 01:27
A badass list of frontend development resources I collected over time.
@kennydude
kennydude / Java.java
Created July 14, 2012 14:31
Encrypt from Java and decrypt on Node.js
// Encrypt where jo is input, and query is output and ENCRPYTION_KEy is key
byte[] input = jo.toString().getBytes("utf-8");
MessageDigest md = MessageDigest.getInstance("MD5");
byte[] thedigest = md.digest(ENCRYPTION_KEY.getBytes("UTF-8"));
SecretKeySpec skc = new SecretKeySpec(thedigest, "AES/ECB/PKCS5Padding");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
cipher.init(Cipher.ENCRYPT_MODE, skc);
byte[] cipherText = new byte[cipher.getOutputSize(input.length)];
@longzheng
longzheng / gist:2308859
Last active December 8, 2017 05:09
Windows 8.1 default XAML templates and styles
<!--
//
// Copyright (c) Microsoft Corporation. All Rights Reserved.
//
-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.ThemeDictionaries>