Skip to content

Instantly share code, notes, and snippets.

View omidnasri's full-sized avatar
🏢
PTFCH

Omid Nasri omidnasri

🏢
PTFCH
View GitHub Profile
@HereChen
HereChen / convert-image-to-base64.js
Last active March 29, 2022 11:31
convert image to base64
/**
* version1: convert online image
* @param {String} url
* @param {Function} callback
* @param {String} [outputFormat='image/png']
* @author HaNdTriX
* @example
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){
console.log('IMAGE:',base64Img);
})
@PurpleBooth
PurpleBooth / README-Template.md
Last active May 1, 2024 17:49
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

using System.Collections.Generic;
using System.Linq;
 
namespace NumberToWordsLib
{
 /// <summary>
 /// Number to word languages
 /// </summary>
 public enum Language
 {
@ivandnepr90
ivandnepr90 / FtpHelper.php
Created November 21, 2014 14:35
Ftp helper
<?php
/**
* Created by JetBrains PhpStorm.
* User: dn211290sia
* Date: 25.10.14
* Time: 10:00
* To change this template use File | Settings | File Templates.
*/
namespace Common\Utility\GeneralPurpose;
@koldev
koldev / Logger.cs
Created September 23, 2014 10:36
Simple C# Logger class for writing log entries to console and/or file
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading;
public sealed class Logger
{
[Flags]
public enum Targets
{
@eternnoir
eternnoir / gist:9777420
Last active May 3, 2022 05:25
Ftp Client With C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Net;
namespace Lib.Common
{
public class FtpClient
@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
{
@azat-co
azat-co / jquery-api.md
Last active November 2, 2022 19:33
The list of most commonly used jQuery API functions

Here is the list of most commonly used jQuery API functions:

  • find(): Selects elements based on the provided selector string
  • hide(): Hides an element if it was visible
  • show(): Shows an element if it was hidden
  • html(): Gets or sets an inner HTML of an element
  • append() Injects an element into the DOM after the selected element
  • prepend() Injects an element into the DOM before the selected element
  • on(): Attaches an event listener to an element
  • off() Detaches an event listener from an element
@razvanstan
razvanstan / [jQuery] find element by data attribute
Created June 17, 2013 04:47
[jQuery] find element by data attribute
$('#id').find('[data-name="' + js_var + '"]');
@ajaxray
ajaxray / cookies.min.js
Created November 26, 2012 09:32
Small JavaScript class to help create, read and delete cookie. [compressed]
/**
* Cookies - [compressed] A small class to manipulate cookies from javascript
* Uncompressed version: https://gist.github.com/gists/4139367
*/
window.Cookies={set:function(e,t,n,r){if(n){var i=new Date;i.setTime(i.getTime()+n*24*60*60*1e3);var s="; expires="+i.toGMTString()}else var s="";var o=r||"/";document.cookie=e+"="+t+s+"; path="+o},get:function(e){var t=e+"=";var n=document.cookie.split(";");for(var r=0;r<n.length;r++){var i=n[r];while(i.charAt(0)==" ")i=i.substring(1,i.length);if(i.indexOf(t)==0)return i.substring(t.length,i.length)}return null},"delete":function(e){this.set(e,"",-1)}}