Skip to content

Instantly share code, notes, and snippets.

@julianxhokaxhiu
julianxhokaxhiu / create-iso.sh
Created September 24, 2016 21:46
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@umidjons
umidjons / enter-as-tab-directive.md
Created January 5, 2015 14:35
AngularJS directive: Enter as Tab

AngularJS directive: Enter as Tab

angular.module('App',[])
	.directive('enter',function(){
		return function(scope,element,attrs){
			element.bind("keydown keypress",function(event){
				if(event.which===13){
 event.preventDefault();
// Connect to origin db
use some_database; // This will be named db
// Connecto to destiny db2
db2 = db.getSiblingDB('some_other_db');
// Only if needed clean destiny collection
db2.some_or_other_collection.remove({});
// Search all origin collection and copy each to destiny collection
@elhoyos
elhoyos / binary
Last active May 25, 2016 21:34
mongo: Copy a collection
$ mongodump -d some_database -c some_collection
$ mongorestore -d some_other_db -c some_or_other_collection dump/some_collection.bson
@mdunisch
mdunisch / How you get Sail.js running on Openshift.md
Last active July 13, 2023 14:51
Get Sails.js running on Openshift

#How you get Sail.js running on Openshift#

This instruction is tested with:

  • Sails.js v0.9.16
  • Node.js 0.10 on Openshift ( 05 May 2014)

###1) package.json

If you use the package.json build by sails new Projectname than you have to add a few fields for openshift – so the server can start you app automatically. Sails uses Grunt to build minify css/js and so on. Openshift dont have grunt installed so you have to add this also.

@Azazeo
Azazeo / crawler.py
Created January 13, 2014 09:49
Crawler and data extractor for airbnb.com website
MAX_THREADS = 5
delay = 0.5
import psycopg2
import re
import sys
import time
import threading
import urllib2
import urlparse
module.exports = {
format: 'json',
apiVersion: '2013-11-04',
endpointPrefix: 'kinesis',
jsonVersion: '1.1',
serviceFullName: 'Amazon Kinesis',
signatureVersion: 'v4',
targetPrefix: 'Kinesis_20131104',
timestampFormat: 'iso8601',
operations: {
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@icodejs
icodejs / highchartsDraggable.js
Created October 25, 2012 08:34
JS: Highcharts draggable shim
// http://jsfiddle.net/icodejs/TAVz5/
(function(Highcharts) {
var
addEvent = Highcharts.addEvent,
each = Highcharts.each;
/**
* Filter by dragMin and dragMax
*/
@sposmen
sposmen / rsync-ssh.md
Last active October 23, 2020 08:15
Rsync con ssh, o sea para que no pida contraseñas, es decir,con certificados

Realizar backups de manera facil con rsync y ssh Enviado por RazaMetaL el Mié, 2007-02-14 14:27. Tengo dos servidores, uno tiene un eggdrop que guarda el log de actividad de un canal en /home/bot/logs/canal. Hasta ahi todo esta muy bien, pero requiero que esos logs se publiquen en un sitio web que se encuentra en otro servidor.

La manera mas sencilla y practica que encontre para hacer esta tarea fue usando rsync para sincronizar los archivos de log desde un servidor a otro y que solo se copien los archivos nuevos o modificados.

Primero vamos a decidir las opciones para rsync, en mi caso y como lo explico en el parrafo anterior requiero copiar todos los archivos al nuevo servidor, despues que copie solo los nuevos archivos y/o los modificados. Todo esto lo logro pasando las opciones -avz y -e ssh a rsync.

-a para copiar recursivamente manteniendo privilegios, fecha de creacion, permisos, etc.;