Skip to content

Instantly share code, notes, and snippets.

View HalidCisse's full-sized avatar
🎯
Focusing

Halid Cisse HalidCisse

🎯
Focusing
View GitHub Profile
# Video: http://rubyhoedown2008.confreaks.com/08-chris-wanstrath-keynote.html
Hi everyone, I'm Chris Wanstrath.
When Jeremy asked me to come talk, I said yes. Hell yes. Immediately. But
then I took a few moments and thought, Wait, why? Why me? What am I supposed
to say that's interesting? Something about Ruby, perhaps. Maybe the
future of it. The future of something, at least. That sounds
keynote-y.
@Ciantic
Ciantic / keyboardlistener.cs
Created July 11, 2010 17:33
C# Keyboard listener
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using System.Windows.Input;
using System.Windows.Threading;
using System.Collections.Generic;
namespace Ownskit.Utils
{
@davidfowl
davidfowl / Examples
Created May 21, 2011 08:19
Powershell function that recursively walks all project items within a project and lets you execute an action on each one
# Print all project items
Recurse-Project -Action {param($item) "`"$($item.ProjectItem.Name)`" is a $($item.Type)" }
# Function to format all documents based on https://gist.github.com/984353
function Format-Document {
param(
[parameter(ValueFromPipelineByPropertyName = $true)]
[string[]]$ProjectName
)
Process {
@danielphillips
danielphillips / UILabel+dynamicSizeMe.h
Created June 2, 2011 22:54
Adjust UILabel to change it's frame according to it's content
@interface UILabel (dynamicSizeMe)
-(float)resizeToFit;
-(float)expectedHeight;
@end
@shiawuen
shiawuen / index.html
Created December 29, 2011 15:05
Sample to upload file by chunk
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>test upload by chunk</title>
</head>
<body>
<input type="file" id="f" />
<script src="script.js"></script>
@jbtule
jbtule / AESGCM.cs
Last active October 30, 2023 21:14
I have two code examples that I wrote for best practices encrypting a string in c#. They are both using authenticated encryption. http://stackoverflow.com/a/10366194/637783
/*
* This work (Modern Encryption of a String C#, by James Tuley),
* identified by James Tuley, is free of known copyright restrictions.
* https://gist.github.com/4336842
* http://creativecommons.org/publicdomain/mark/1.0/
*/
using System;
using System.IO;
using System.Text;
@mganss
mganss / Pool.cs
Created January 2, 2013 12:55
A buffer pool and an in-memory stream that uses it.
using System;
using System.Collections.Concurrent;
namespace XY
{
public interface IPool<T>
{
T Take();
void Return(T t);
}
@maciekish
maciekish / UIApplication+NetworkActivity.h
Last active November 27, 2021 06:58
UIApplication+NetworkActivity keeps track of how many network operations you currently have and manages the NetworkActivityIndicator for you.
//
// UIApplication+NetworkActivity.h
//
// Created by Maciej Swic on 2013-04-29.
// Released under the MIT license.
//
#import <UIKit/UIKit.h>
@interface UIApplication (NetworkActivity)
@maciekish
maciekish / NSHTTPCookieStorage+FreezeDry.h
Last active February 25, 2021 22:04
Persists UIWebView cookies to disk. To send the cookies with an initial NSURLRequest you must do the following after loading the cookies: NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:yourURL]; NSDictionary* headers = [NSHTTPCookie requestHeaderFieldsWithCookies:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]]; [requ…
//
// NSHTTPCookieStorage+FreezeDry.h
//
// Created by Maciej Swic on 19/08/13.
//  
// 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
@jogleasonjr
jogleasonjr / SlackClient.cs
Last active October 20, 2023 15:54
A simple C# class to post messages to a Slack channel. You must have the Incoming WebHooks Integration enabled. This class uses the Newtonsoft Json.NET serializer available via NuGet. Scroll down for an example test method and a LinqPad snippet. Enjoy!
using Newtonsoft.Json;
using System;
using System.Collections.Specialized;
using System.Net;
using System.Text;
//A simple C# class to post messages to a Slack channel
//Note: This class uses the Newtonsoft Json.NET serializer available via NuGet
public class SlackClient
{