Skip to content

Instantly share code, notes, and snippets.

View punkch's full-sized avatar
🎣
I'd rather be fishing

Pencho BELNEYSKI punkch

🎣
I'd rather be fishing
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
var mediaJSON = { "categories" : [ { "name" : "Movies",
"videos" : [
{ "description" : "Big Buck Bunny tells the story of a giant rabbit with a heart bigger than himself. When one sunny day three rodents rudely harass him, something snaps... and the rabbit ain't no bunny anymore! In the typical cartoon tradition he prepares the nasty rodents a comical revenge.\n\nLicensed under the Creative Commons Attribution license\nhttp://www.bigbuckbunny.org",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4" ],
"subtitle" : "By Blender Foundation",
"thumb" : "images/BigBuckBunny.jpg",
"title" : "Big Buck Bunny"
},
{ "description" : "The first Blender Open Movie from 2006",
"sources" : [ "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4" ],
@punkch
punkch / deployment.yml
Created May 20, 2019 10:37 — forked from troyharvey/deployment.yml
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@punkch
punkch / generate-pushid.js
Created April 15, 2019 10:48 — forked from mikelehen/generate-pushid.js
JavaScript code for generating Firebase Push IDs
/**
* Fancy ID generator that creates 20-character string identifiers with the following properties:
*
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits
* but "incrementing" them by 1 (only in the case of a timestamp collision).
*/
@punkch
punkch / cookiesAuthXHRAPI.js
Created June 3, 2017 20:59 — forked from gautamsi/ cookiesAuthXHRAPI.js
ews-javascript-api with cookies Authentication of TMG (Thread management Gateway) (or ISA Server)
var ews = require("ews-javascript-api");
var PromiseFactory = ews.PromiseFactory;
var request = require('httpreq');
var cookiesXHRApi = (function () {
function cookiesXHRApi(user, password) {
this.cookies = [];
this.userName = user;
this.password = password;
}
cookiesXHRApi.prototype.xhr = function (xhroptions) {

Keybase proof

I hereby claim:

  • I am punkch on github.
  • I am punkch (https://keybase.io/punkch) on keybase.
  • I have a public key whose fingerprint is 6F70 97F8 C937 3DD1 74E7 6D39 3FB7 655B 92DB 546A

To claim this, I am signing this object:

@punkch
punkch / tv_grab_url-setup.py
Created November 6, 2016 22:56 — forked from saihtaM/tv_grab_url-setup.py
TVHeadend tv_grab_url - with automatic setup script for Linux Newbies.
#!/usr/bin/env python
# coding=utf-8
import os
import sys,stat
import urllib2
installto = "/usr/bin/tv_grab_url"
def replace_line(file_name, line_num, text):
#Stolen from http://stackoverflow.com/questions/4719438/editing-specific-line-in-text-file-in-python
@punkch
punkch / WebServiceInvoker.cs
Created May 18, 2016 10:18 — forked from escobar5/WebServiceInvoker.cs
Dynamically invoking a web service
using System;
using System.CodeDom;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Reflection;
using System.ServiceModel;
using System.ServiceModel.Description;
using System.ServiceModel.Security;
@punkch
punkch / addselftosqlsysadmin.cmd
Created January 5, 2016 12:06 — forked from wadewegner/addselftosqlsysadmin.cmd
Script to add the current user to the sysadmin role in SQL Server
@echo off
rem
rem ****************************************************************************
rem
rem Copyright (c) Microsoft Corporation. All rights reserved.
rem This code is licensed under the Microsoft Public License.
rem THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
rem ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
rem IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
rem PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.