Skip to content

Instantly share code, notes, and snippets.

View dlion's full-sized avatar
🦁
If you can dream it, you can do it ~

Domenico Luciani dlion

🦁
If you can dream it, you can do it ~
View GitHub Profile
@marpontes
marpontes / disable-gpu-mac.md
Created October 5, 2017 12:40
Pass --disable-gpu down to Electron apps on mac (Slack, Whatsapp, Trello, ...)

On my Macbook Pro (OS X El Capitan) I was having issues on Electron based apps. These apps had visual issues/glitches like blank screens, visual components showing only when hovering or transparent menus.

By opening with these comands, the problems disappeared.

open /Applications/Slack.app/ --args --disable-gpu
open /Applications/Trello.app/ --args --disable-gpu
open /Applications/Whatsapp.app/ --args --disable-gpu
package main
import (
"fmt"
"io"
"os"
)
var path = "/Users/novalagung/Documents/temp/test.txt"
@emiralp
emiralp / gist:010e3cc7119ab4a39d4b
Last active March 12, 2018 10:33
cmd.fm api v.1 (beta)

USERS

/api/users/sign_up
	username				(Required)
	email					(Required)
	password				(Required)
	password_confirmation	(Required)
	
/api/users/sign_in

username_or_email (Required)

#include <stdio.h>
#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
void usage();
int main(int argc, char *args[]){
@gitaarik
gitaarik / git_submodules.md
Last active November 16, 2024 19:55
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@joaoneto
joaoneto / login.test.js
Created March 13, 2013 13:49
Login session test with mocha
var request = require('supertest'),
should = require('should'),
app = require('../server');
var Cookies;
describe('Functional Test <Sessions>:', function () {
it('should create user session for valid user', function (done) {
request(app)
.post('/v1/sessions')
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@mrichardson23
mrichardson23 / rpi-gui-gpio.py
Created July 23, 2012 14:35
GUI and GPIO on Raspberry Pi
from Tkinter import *
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
def say_hi():
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a