Skip to content

Instantly share code, notes, and snippets.

View lionello's full-sized avatar
🇭🇰

Lio李歐 lionello

🇭🇰
View GitHub Profile
@bgreenlee
bgreenlee / Versioning.sh
Last active June 13, 2022 16:42
Automatic project versioning for Xcode using git commits & tags #xcode #git
#!/bin/sh
# Versioning.sh
#
# https://gist.github.com/791352 by Marc Hedlund
#
# Found at http://kswizz.com/post/2686511526/git-xcode-versioning and slightly
# modified.
# To install:
@metaskills
metaskills / gist:893599
Created March 29, 2011 23:54
A Copy Of sp_MSforeachtable Stored Procedure For Azure, Uses sp_MSforeach_worker
CREATE proc [dbo].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
AS
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
@lionello
lionello / wol.c
Created September 8, 2013 02:48
Wake-On-LAN
// Portable Wake-On-Lan by Lionello Lunesu, placed in the public domain
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#ifdef _MSC_VER
#pragma comment(lib, "ws2_32.lib")
#endif
#else
#include <sys/socket.h>
@woutgg
woutgg / dhcp
Created March 6, 2014 21:09
openwrt ap+sta configuration
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
@neilco
neilco / RSASHA1.swift
Created April 27, 2015 09:07
RSA-SHA1 signing with a PKCS#12 private key
//
// RSASHA1.swift
//
// Copyright (c) 2015 Neil Cowburn. All rights reserved.
//
// 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
@colinvh
colinvh / aws.md
Last active May 8, 2024 15:31
AWS Region Names

Alternative naming schemes for AWS regions

Purpose

The intent is to define terse, standards-supported names for AWS regions.

Schemes

@madhikarma
madhikarma / build_framework.sh
Created October 13, 2015 12:26
Script to build a framework for multiple architectures
# Merge Script
# http://code.hootsuite.com/an-introduction-to-creating-and-distributing-embedded-frameworks-in-ios/
# 1
# Set bash script to exit immediately if any commands fail.
set -e
# 2
# Setup some constants for use later on.
@ArthurYidi
ArthurYidi / translatekeycodes.swift
Created April 6, 2016 02:57
virtual key codes to unicode characters
func keyCodeToString(keyCode: CGKeyCode) -> String {
let curKeyboard = TISCopyCurrentKeyboardInputSource().takeRetainedValue()
let ptr = TISGetInputSourceProperty(curKeyboard, kTISPropertyUnicodeKeyLayoutData)
let keyboardLayoutPtr = UnsafePointer<UCKeyboardLayout>(ptr)
var deadKeyState: UInt32 = 0
var actualStringLength = 0
var unicodeString = [UniChar](count: 255, repeatedValue: 0)
let status = UCKeyTranslate(keyboardLayoutPtr,
#include <SoftwareSerial.h>
#include <Wire.h>
#include <SparkFunHTU21D.h>
#include<stdlib.h>
#include "DHT.h"
#define SSID "XinCheJian"//your network name
@paperdigits
paperdigits / default.nix
Created January 10, 2017 06:15
nix-shell environment for middleman
# nix-shell -p bundler bundix
# bundler lock && bundler package --path vendor/cache --no-install && bundix && exit
# nix-shell
with (import <nixpkgs> {});
let
env = bundlerEnv {
name = "test-package";
inherit ruby;
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;