Skip to content

Instantly share code, notes, and snippets.

View ufukomer's full-sized avatar
🌍
On Earth

Ömer Ufuk Efendioğlu ufukomer

🌍
On Earth
View GitHub Profile
@ufukomer
ufukomer / git-commands.md
Last active July 7, 2020 11:08
Git Commands

Clone respotory to your pc

$ git clone 'ssh clone url'

Push

$ git add .
$ git commit -m "Your message"
$ git push -u origin master
@danthareja
danthareja / promises.js
Last active July 25, 2023 03:05
A conjurer's guide to promises
/*
* A quick example of how to use Bluebird and Q to conjure your own promises
*
* Everything going on here is explained further in the following video:
* http://youtu.be/OU7WuVGSuZw?list=PLT-DLWOBKbB4dZ83I_7Ca-sUTvorckG-E
*
*/
// Import node modules
var Q = require('q');
'use strict';
/**
* Adapted from https://github.com/Khan/react-components/blob/master/js/timeout-transition-group.jsx
* with the following additions:
*
* - Use BEM-ish modifiers (--enter, --enter--active, --leave, --leave--active)
* - Work better with rAF batching strategy (see https://github.com/facebook/react/issues/2292)
*
* The CSSTransitionGroup component uses the 'transitionend' event, which
@tonymtz
tonymtz / gist:714e73ccb79e21c4fc9c
Created November 15, 2014 00:02
Uninstall XQuartz.app from OSX Yosemite
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
# Log out and log in
@greggman
greggman / promisesequence.js
Last active November 2, 2022 21:38
Run promises in sequence until one succeeds
var Promise = require('promise');
// A function returns a function that will generates a promise when called.
// It will wait 1 second before fulfilling or rejecting the promise. Second argument f = true mean "fail!"
var fn = function(v, f) {
return function() {
return new Promise(function(fulfill, reject) {
setTimeout(function() {
console.log(new Date());
@plentz
plentz / nginx.conf
Last active May 17, 2024 09:08
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@zziuni
zziuni / stuns
Created September 18, 2012 08:05
STUN server list
# source : http://code.google.com/p/natvpn/source/browse/trunk/stun_server_list
# A list of available STUN server.
stun.l.google.com:19302
stun1.l.google.com:19302
stun2.l.google.com:19302
stun3.l.google.com:19302
stun4.l.google.com:19302
stun01.sipphone.com
stun.ekiga.net
@lyhcode
lyhcode / zlib-demo.js
Created April 2, 2012 10:38
Node.js + Gzip/Deflate Compression
var zlib = require('zlib');
var compress = function(req, res, result) {
var acceptEncoding = req.headers['accept-encoding'];
if (!acceptEncoding) { acceptEncoding = ''; }
if (acceptEncoding.match(/\bdeflate\b/)) {
zlib.deflate(result, function(err, result) {
if (!err) {
res.writeHead(200, { 'content-encoding': 'deflate' });
res.send(result);
@mbostock
mbostock / .block
Last active January 26, 2022 14:32 — forked from mbostock/.block
Spline Transition
license: gpl-3.0
@mbostock
mbostock / .block
Last active November 22, 2022 23:32
Line Transition
license: gpl-3.0