Skip to content

Instantly share code, notes, and snippets.

View cchitsiang's full-sized avatar
💭
🤖 AI & the Future of Work | 🏗️ Software Architecture & Design

Chew Chit Siang cchitsiang

💭
🤖 AI & the Future of Work | 🏗️ Software Architecture & Design
  • Kuala Lumpur, Malaysia
  • 10:17 (UTC +08:00)
View GitHub Profile
require 'sinatra' # gem install sinatra --no-rdoc --no-ri
set :port, 3000
set :environment, :production
html = <<-EOT
<html><head><style>
#text{width:100%; font-size: 15px; padding: 5px; display: block;}
</style></head><body>
<input id="text" placeholder="Write then press Enter."/>
<div id="chat"></div>
#!/usr/bin/env ruby
require 'koala' # gem install koala --no-ri --no-rdoc
# create a facebook app and get access token from here
# https://developers.facebook.com/tools/explorer
# select "groups", "photos" when authenticating
oauth_access_token = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
group_filtering_words = ['ruby']
image_path = 'image.png' #change to your image path
message = 'My Cool image.' # your message
@cchitsiang
cchitsiang / modifyConnectionStrings.ps1
Created February 25, 2014 01:51 — forked from jwcarroll/modifyConnectionStrings.ps1
Set Connection String Powershell Function Usage: Set-ConnectionString "MyWebApp\app.config" MyConnectionString "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;" Other Reference for more scenario : http://www.protosystem.net/post/2009/06/01/Using-Powershell-to-manage-application-configuration.aspx
Function Set-ConnectionString{
[CmdletBinding(SupportsShouldProcess=$True)]
Param(
[string]$fileName="app.config",
[string]$connectionStringName,
[string]$connectionString
)
$config = [xml](Get-Content -LiteralPath $fileName)
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
;
; "CMD Prompt Here" PowerToy
;
; Copyright 1996 Microsoft Corporation
;
; Modified to launch VS.NET 2010 command prompt 5/6/03 MG
; Modified to launch VS.NET 2012 command prompt 9/4/12 KZU
; Modified to add context menu to a directory background 9/27/12 SinaIRV
[version]
@cchitsiang
cchitsiang / InstallHelpFiles.ps1
Created December 13, 2013 08:41
Install/Remove SharePoint Help site collection files in the current farm.
Get-SPHelpCollection
Install-SPHelpCollection -LiteralPath
Uninstall-SPHelpCollection
@cchitsiang
cchitsiang / Remove-SPServiceApplication.ps1
Created December 12, 2013 05:41
Remove SharePoint Service Application Pool
$spapp = Get-SPServiceApplication -Name "User Profile Service Application”
Remove-SPServiceApplication $spapp
[Microsoft.SharePoint.Administration.SPWebService]::ContentService.ApplicationPools | ft Name
[Microsoft.SharePoint.Administration.SPWebService]::AdministrationService.ApplicationPools | ft Name
Get-SPServiceApplicationPool | ft name
#region (c) 2010-2011 Lokad - CQRS for Windows Azure - New BSD License
// Copyright (c) Lokad 2010-2011, http://www.lokad.com
// This code is released as Open Source under the terms of the New BSD Licence
#endregion
using System;
using System.Configuration;
using System.Diagnostics;
%windir%\system32\inetsrv\appcmd.exe list wp