Skip to content

Instantly share code, notes, and snippets.

View bsingr's full-sized avatar

bsingr

  • @coliquio - former Sophos, Git Tower, Inovex, 1&1
  • Lake Constance, Germany
View GitHub Profile
@bsingr
bsingr / browser.txt
Last active February 16, 2016 09:46
DNS Change
# Chrome
chrome://net-internals/#dns
# Firefox
about:config
@bsingr
bsingr / raspberry.sh
Last active February 19, 2016 08:51
Install Raspbian
#!/bin/bash
# login user=pi pass=raspberry
sudo su
# apt-get update
# apt-get install -y --no-install-recommends parted
parted # resize to full disk
@CMCDragonkai
CMCDragonkai / ways_of_piping_and_redirection.sh
Last active March 12, 2024 11:06
BASH: Ways of Piping/Redirection and Heredoc Demonstration
# shells are an orchestration environment
# the language they provide is intended to orchestrate processes
# on the operating system
# if programs are functions, then all of the below are variants of function application
# anonymous pipe
echo "string" | cat
# herestring
cat <<< "string"
@crittermike
crittermike / gist:7b654d3d686a4e434eda
Created March 26, 2015 00:56
Run a single specific Drupal update hook using Drush
drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();"
@threez
threez / mini-sqlite3.rb
Last active August 29, 2015 14:16
minimal sqlite3 driver
#!/usb/bin/env ruby
require 'fiddle'
require 'fiddle/import'
require 'pp'
module Sqlite3
SQLITE_OK = 0
module Driver
extend Fiddle::Importer
@bsingr
bsingr / client-example.js
Created December 18, 2014 18:01
hibiscus xmlrpc nodejs client example
// call the hibiscus xml rpc from nodejs
// see http://www.willuhn.de/wiki/doku.php?id=develop:xmlrpc#xml-rpc-aufrufe_im_detail
// install:
// npm install --save xmlrpc underscore
// run:
// node client-example.js
var xmlrpc = require('xmlrpc'),
@tkafka
tkafka / LICENSE.txt
Last active May 17, 2024 02:08
Drop-in replacement for ReactCSSTransitionGroup that uses velocity.js instead of CSS transforms. Add your own transitions to `transitions` hash.
The MIT License (MIT)
Copyright (c) 2014 Tomas Kafka
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@bsingr
bsingr / README.md
Created October 22, 2014 09:21
10k tcp/tls connections with node.js

Generate certs, remember to use to proper CN (my.example.com)

  openssl req -x509 -newkey rsa:2048 -keyout config/key.pem -out config/cert.pem -days 365
  openssl rsa -in config/key.pem -out config/key.pem

Install the server on a host that is reachable from the client via my.example.com. E.g. edit /etc/hosts...

@jasny
jasny / bootstrap-em.less
Last active January 5, 2020 15:36
Use em or rem font-size in Bootstrap 3
/**
* Use em or rem font-size in Bootstrap 3
*/
@font-size-root: 14px;
@font-unit: 0rem; // Pick em or rem here
// Convert all variables to em
@bsingr
bsingr / defines.h
Created February 12, 2014 15:54
Drawing on non-retina devices.
// https://developer.apple.com/library/ios/documentation/2ddrawing/conceptual/drawingprintingios/graphicsdrawingoverview/graphicsdrawingoverview.html
#define ALIGN_POINT_TO_PIXEL(floatValue) ( (((NSInteger) roundf(floatValue)) % 2 == 0) ? floatValue : floatValue + 0.5f )
// Usage:
// rect.x = ALIGN_POINT_TO_PIXEL(rect.x)