This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function jsonval { | |
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop` | |
echo ${temp##*|} | |
} | |
json=`curl -s -X GET http://twitter.com/users/show/$1.json` | |
prop='profile_image_url' | |
picurl=`jsonval` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove from CRX all files deleted from file system | |
$ vlt st | grep ! | cut -c 2- | xargs -I {} vlt rm {} | |
# add to CRX all files not yet in vlt control | |
$ vlt st | grep \? | cut -c 2- | xargs -I {} vlt add {} | |
# add all missing files into the CRX | |
vlt st | grep ^A | cut -c 2- | xargs -I {} vlt commit --force {} | |
# copy all modified files into the CRX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.sample.osgi; | |
import java.util.Map; | |
import org.apache.felix.scr.annotations.Activate; | |
import org.apache.felix.scr.annotations.Component; | |
import org.apache.felix.scr.annotations.Modified; | |
import org.apache.felix.scr.annotations.Property; | |
@Component(label = "Service Label", description = "Service Description", metatype = true, immediate = true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note 1: The following CQ curl commands assumes a admin:admin username and password. | |
Note 2: For Windows/Powershell users: use two "" when doing a -F cURL command. | |
Example: -F"":operation=delete"" | |
Note 3: Quotes around name of package (or name of zip file, or jar) should be included. | |
Uninstall a bundle (use http://localhost:4505/system/console/bundles to access the Apache Felix web console) | |
curl -u admin:admin -daction=uninstall http://localhost:4505/system/console/bundles/"name of bundle" | |
Upload a package AND install | |
curl -u admin:admin -F file=@"name of zip file" -F name="name of package" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Intercepting HTTP calls with AngularJS. | |
angular.module('MyApp', []) | |
.config(function ($provide, $httpProvider) { | |
// Intercept http calls. | |
$provide.factory('MyHttpInterceptor', function ($q) { | |
return { | |
// On request success | |
request: function (config) { | |
// console.log(config); // Contains the data about the request before it is sent. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var http = require('http'); | |
var parseTrack = function (data) { | |
var trackLines = data.replace(/[\r\n]/g, '').replace(/<\/tr>/gi, '</tr>\n').match(/<tr.*?>(.*)<\/tr>/gi); | |
trackLines.shift(); | |
var parsed = [], parts = []; | |
var length = trackLines.length; | |
var details, date, track; | |
for (;length--;) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import eyed3 | |
import re | |
import glob | |
def get_lyric(lrc): | |
text = open(lrc).read() | |
text = re.sub(r'(?:\[.*\])+', '', text).strip() | |
text = map(lambda l: l.strip(), text.split('\n')) | |
ans = [] | |
for l in text: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.File; | |
public class DirectoryReader { | |
static int spc_count=-1; | |
static void Process(File aFile) { | |
spc_count++; | |
String spcs = ""; | |
for (int i = 0; i < spc_count; i++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@Application Language='C#' Inherits="Website.Global" CodeBehind="Global.asax.cs" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove from CRX all files deleted from file system | |
$ vlt st | grep ! | cut -c 2- | xargs -I {} vlt rm {} | |
# add to CRX all files not yet in vlt control | |
$ vlt st | grep \? | cut -c 2- | xargs -I {} vlt add {} | |
# add all missing files into the CRX | |
vlt st | grep ^A | cut -c 2- | xargs -I {} vlt commit --force {} | |
# copy all modified files into the CRX |
OlderNewer